var parseDate = d3.time.format("%a %b %e %H:%M:%S CST %Y").parse;

function initTime(){

	/*  Infrastructure for charts  */
	brush = d3.svg.brush()
		.x(timeX)
		.on("brush", brush);

	svg2.append("g")
		.attr("class", "x brush")
		.call(brush)
			.selectAll("rect")
			.attr("y", -6)
			.attr("height", timeChartHeight + 7);

}

function brush(){
	document.getElementById("label2").setAttribute("value", brush.extent()[1]);
	update(brush.extent()[1]);
}

function update(cursordate){
	var nodes = svg1.selectAll("circle.node")
	.transition()
	.duration(500)
	.style("fill", function(d) {d.name == "fuck4" ? "#1f77b4" : "#aec7e";})
	.style("fill", function(d) { return d.date < cursordate  ? color(1) : color(0); });


}